import { get, post, del } from "../utils/request";

//获取购物车数据
export const loadCartsAPI = () => get("/api/v1/shop_carts");

//加入购物车
/** product, 商品id
    amount,   商品数量  如果要减  直接传-1
    price, */ //商品价格

export const addToCart = (product, amount, price) =>
  post("/api/v1/shop_carts", {
    product,
    amount,
    price,
  });

//删除购物车数据
//id  购物车的id
export const delFromCart = (id) => del("/api/v1/shop_carts/" + id);
